/**
 * 空
 * @param color 颜色
 * @param pixelSize 像素尺寸
 * @returns 数据地址
 */
const EmptyImage = (color?: string, pixelSize?: number) => {
    const col = color || '#ffffff';
    const siz = pixelSize || 4;
    const canvas = document.createElement('canvas');
    canvas.width = canvas.height = siz;
    const ctx = canvas.getContext('2d')!;

    ctx.fillStyle = col;
    ctx.beginPath();
    ctx.moveTo(0, 0);
    ctx.lineTo(siz, 0);
    ctx.lineTo(siz, siz);
    ctx.lineTo(0, siz);
    ctx.lineTo(0, 0);
    ctx.closePath();
    ctx.fill();

    return canvas.toDataURL('image/png');
}


export { EmptyImage };